package coroutines.coroutinebuilder

import kotlinx.coroutines.*

class LaunchTest {
}

fun main() {
    runBlocking(context = Dispatchers.IO) {
        launch(start = CoroutineStart.LAZY) {
            println("launch start = CoroutineStart..LAZY, start")
            delay(1000)
            println("launch start = CoroutineStart.LAZY, completed")
        }

        launch(start = CoroutineStart.DEFAULT) {
            println("launch start = CoroutineStart.DEFAULT, start")
            delay(1000)
            println("launch start = CoroutineStart.DEFAULT, completed")
        }

        launch(start = CoroutineStart.ATOMIC) {
            println("launch start = CoroutineStart.ATOMIC, start")
            delay(1000)
            println("launch start = CoroutineStart.ATOMIC, completed")
        }

        launch(start = CoroutineStart.UNDISPATCHED) {
            println("launch start = CoroutineStart.UNDISPATCHED, start")
            delay(1000)
            println("launch start = CoroutineStart.UNDISPATCHED, completed")
        }
    }
}